export function eachObject(object:any,key:string|number,parent:any,handle:(value:any,key:string|number, parent:any)=>void){
    if (Array.isArray(object)){
        object.forEach((it,index)=>{
            eachObject(it,index,object,handle)
        })
    }else if (typeof object==="object"){
        for (const k in object) {
            eachObject(object[k],k,object,handle)
        }
    }else {
        handle(object,key,parent)
    }
}

export function eachAnyIfIsObject(object:any,handle:(value:any,key:string|number,parent:any)=>void){
    if (Array.isArray(object)){
        object.forEach((it,index)=>{
            eachObject(it,index,object,handle)
        })
    }else if (typeof object==="object"){
        for (const k in object) {
            eachObject(object[k],k,object,handle)
        }
    }
}